[Test Improver] tests: skip runtime factory tests when LLM not installed#1139
Draft
danielmeppiel wants to merge 1 commit intomainfrom
Draft
[Test Improver] tests: skip runtime factory tests when LLM not installed#1139danielmeppiel wants to merge 1 commit intomainfrom
danielmeppiel wants to merge 1 commit intomainfrom
Conversation
Four tests in test_runtime_factory.py assumed LLM is installed on the host system. In CI (and most dev environments), only Copilot/Codex may be present, causing spurious failures. Fix: add module-level skip markers that probe runtime availability at collection time. LLM-specific tests skip gracefully when 'llm' runtime is absent; runtime-agnostic tests remain unconditional. Also refactored test_get_available_runtimes_real_system to not assume LLM is present, and split the LLM-specific assertion into a separate skippable test. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 Test Improver - automated AI assistant for test improvements.
Goal and Rationale
Four tests in
test_runtime_factory.pyhard-coded assumptions that thellmruntime is installed on the host system. In CI (and standard dev environments without thellmPython package), these tests fail unconditionally with:This creates noise in CI output and obscures real failures.
Approach
Added module-level skip markers that probe runtime availability at collection time using the factory's own
runtime_exists()method - so the logic is consistent with production code:test_get_runtime_by_name_llm_real,test_create_runtime_with_name_real,test_runtime_exists_llm_true) now skip gracefully when LLM is absenttest_get_available_runtimes_real_systemrefactored to be environment-agnostic (any list is valid)test_get_available_runtimes_includes_llmtest captures the LLM-specific assertion, also skippableget_best_available_runtimeandcreate_runtime(auto-detect) skip when no runtime at all is availableCoverage Impact
The tests still run and assert correctness when the runtime is present.
Trade-offs
Reproducibility
Test Status
test_runtime_factory.pytest_policy_status.pyare pre-existing (unrelated to this PR)